<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
	function cx() {
		var bjId=$('#bj').val();
		var kcId=$('#kc').val();
		if(bjId==0||kcId==0){
			$('#table').empty();
		}else{
			$('#table').load('grade',{method:'kcx',bjId:bjId,kcId:kcId});
		}
	}
	
	function xg(id,grade) {
		
		if(!(/^[1-9]\d*$/.test(grade))){
			alert("请输入正整数");
			return;
		};
		
		$.post('grade',{method:'xg',id:id,grade:grade},function(data){});
	}
	
	function yctable() {
		$('#table').empty();
	}
	
	function fh(){
		window.location="course?method=fh";
	}
</script>

<style type="text/css">
	body{
		width:auto;
		height: auto;
		background-repeat:no-repeat;
		background-size: 100%;
	}
		
	.sss{
		width: 1400px;
		margin: 20px auto;
		padding-bottom: 40px;
		padding-left: 10px;
		padding-right: 10px;
		min-height:100px;
	}
	label{
		display:inline-block;
		width:80px;
		text-align: right;
	}
	
	input{
		padding: 6px;
	}
	
	button{
		float:right;
	}
	
	td,th{
		
		padding: 7px 7px;
	
	}
	
	table{
			width:100%;
            border-collapse: collapse;
            margin: 0 auto;
            text-align: center;
            border-bottom-color:#666;
        }
    table td, table th{
            border: 1px solid #cad9ea;
            color: #666;
            height: 30px;
        }
    table thead th{
            background-color: #CCE8EB;
            width: 100px;
            min-width: 200px;
        }
    table tr:nth-child(odd){
            background: #fff;
   	 }
    
    table tr:nth-child(even)
        {
            background: #F5FAFA;
        }
	
	
	h3{
		text-align: center;
	}
	
	button{
		padding: 5px 10px;
		margin-left:2px;
		margin-bottom: 3px;
		width:85px;
		}
		
	}
</style>

<meta charset="UTF-8">
<title>按班级录入成绩</title>
</head>
<body>
<div class="sss">
	<h3>班级成绩管理</h3>
	<p>	
		<label>班级：</label>
		<select id="bj" onchange="yctable()">
			<option value="0">---请选择---</option>
		<c:forEach items="${bjs}" var="b">
			<option value="${b.id}">${b.name}</option>
		</c:forEach>
		</select>
		<label>课程：</label>
		<select id="kc" onchange="yctable()">
			<option value="0">---请选择---</option>
		<c:forEach items="${kcs}" var="k">
			<option value="${k.id}">${k.name}</option>
		</c:forEach>
		</select>
		<button type="button" onclick="cx()">查询</button>
	</p>
	
	<div id="table">
	
	</div>
</div>
</body>
</html>